<?php
    // Send Header
    $xls->setHeader('Reporte_'.date('Y_m_d').'.xls');

    // XLS Data Cell
    $xls->BOF();
    $xls->writeLabel(1,0,"VENETEL");
    $xls->writeLabel(2,0,"Reporte de Salarios : ");

    $xls->writeLabel(4,0,"Empleado");
    $xls->writeLabel(4,1,"Fecha de Actualizcion");
    $xls->writeLabel(4,2,"Sueldo Asignado");
 	$xls->writeLabel(4,3,"Bono Vacacional");
	$xls->writeLabel(4,4,"Vacaciones");
	$xls->writeLabel(4,5,"Utilidades");
	$xls->writeLabel(4,6,"Bono Celular");
	$xls->writeLabel(4,7,"Prima por Experiencia Proesional");
	$xls->writeLabel(4,8,"Bono alimentacion");
	$xls->writeLabel(4,9,"Educacion");
	$xls->writeLabel(4,10,"Bono estacionamiento");


	$x = 5;
	$y = 0;

	foreach ($salarios as $salario){
    $xls->writeLabel($x, $y++, $salario['Persona']['nombres'].' '.$salario['Persona']['apellidos'], array('controller' => 'personas', 'action' => 'view', $salario['Persona']['id']));
    $xls->writeLabel($x, $y++, $salario['Salario']['fl_actualiza']);
    $xls->writeLabel($x, $y++, $salario['Salario']['mt_salario']);
    $xls->writeLabel($x, $y++, $salario['Salario']['bn_vacaciones']);
    $xls->writeLabel($x, $y++, $salario['Salario']['vacaciones']);
    $xls->writeLabel($x, $y++, $salario['Salario']['utilidades']);
    $xls->writeLabel($x, $y++, $salario['Salario']['bn_celular']);
    $xls->writeLabel($x, $y++, $salario['Salario']['pr_experiencia']);
    $xls->writeLabel($x, $y++, $salario['Salario']['bn_alimentacion']);
    $xls->writeLabel($x, $y++, $salario['Salario']['educacion']);
    $xls->writeLabel($x, $y++, $salario['Salario']['bn_estaciona']);

	$x++;
		if($y === 11) {
			$y = 0;
		}
	}

    $xls->EOF();
    exit();
?>